Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cache inconsistency segfault #2148

Merged
merged 3 commits into from
Nov 28, 2024
Merged

Conversation

tstirrat15
Copy link
Contributor

@tstirrat15 tstirrat15 commented Nov 27, 2024

Fixes #1985

Description

Prior to this fix, you could provoke a segfault by running thumper against a spicedb instance that didn't have a schema in it. It was racy, implying that there was some caching or threading behavior involved, and we added some debug until we found a place where the reader was listing out a nil value that was set as notFound in the cache.

This changes the cache's behavior so that it doesn't list out notFound values, which should prevent this segfault from appearing.

Changes

  • Write a test that exercises the behavior
  • Fix the test

Testing

Review. See that things are green.

@github-actions github-actions bot added area/datastore Affects the storage system area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) labels Nov 27, 2024
@tstirrat15 tstirrat15 force-pushed the fix-cache-inconsistency-segfault branch from 0a4c384 to ce17139 Compare November 28, 2024 00:21
@tstirrat15 tstirrat15 marked this pull request as ready for review November 28, 2024 00:24
@tstirrat15 tstirrat15 requested a review from a team as a code owner November 28, 2024 00:24
Copy link
Member

@josephschorr josephschorr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tstirrat15 tstirrat15 enabled auto-merge November 28, 2024 00:49
@tstirrat15 tstirrat15 added this pull request to the merge queue Nov 28, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 28, 2024
@tstirrat15 tstirrat15 added this pull request to the merge queue Nov 28, 2024
Merged via the queue into main with commit a251139 Nov 28, 2024
22 checks passed
@tstirrat15 tstirrat15 deleted the fix-cache-inconsistency-segfault branch November 28, 2024 01:05
@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/datastore Affects the storage system area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v1.34.0 Segfault on ReadRelationships before WriteSchema when using memstore
2 participants